#ifndef UANALYSERAUDIOINPUT_H
#define UANALYSERAUDIOINPUT_H
#include <QtGui>
#include <qaudioinput.h>


class uAnalyserAudioInput: public QObject
{
    Q_OBJECT
public:
    uAnalyserAudioInput();
    ~uAnalyserAudioInput();
    void startRecording(int sample_rate, int buffer_size, QVector<double> *v);
    void pauseRecording(bool t);
    void stopRecording();

private:
    QBuffer *outputBuffer;   //buffer for data from QAudioInput* audio
    QByteArray *outputByteArray;
    QAudioInput* audio; //audio input(microphone) interface
    int bufferLength;
    int writtenAudioBytes;
    QVector<double> *voltage; //buffer for calculated voltages

public slots:
    void bufferUpdated(qint64 bytesWritten);

signals:
     void audioBufferRefreshed();
};




#endif // UANALYSERAUDIOINPUT_H
